<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>发布代码</title>
        <link href="<?php echo base_url(); ?>CSS/GLOBAL.css" rel="stylesheet" type="text/css">
        <link href="<?php echo base_url(); ?>CSS/WebPages.css" rel="stylesheet" type="text/css">
        <script language="javascript" type="text/javascript" src="<?php echo base_url(); ?>JS/jquery.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo base_url(); ?>JS/xheditor/xheditor-1.1.13-zh-cn.min.js"></script>
        <script type="text/javascript">
            $(pageInit);
            function pageInit()
            {
                $('#C_Description').xheditor({tools:'simple',skin:'nostyle'});
            }
        </script>
    </head>
    <body>

        <div id="CONTAINER" class="Box">

            <div id="Main">
                <div id="Position">
                    代码库分类：
                    <?php
                    if (is_array($category)) {
                        foreach ($category as $category_item) {
                            ?>
                            <a href="<?php echo site_url(); ?>/Code/Select_Category/<?php echo $category_item['Cate_Id'] ?>"><?php echo $category_item['Cate_Name'] ?></a>&nbsp;&nbsp;
                            <?php
                        }
                    }
                    ?>
                </div>
                <?php echo form_open('Code/Eidt_Code'); ?>
                <h3>发布代码</h3>
                <div class="DetailArea">
                    <?php
                    if (isset($error))
                        echo $error;
                    if (is_array($code)) {
                        foreach ($code as $code_item) {
                            ?>
                            <input id="C_Id" name="C_Id" type="hidden" value="<?php echo $code_item['C_Id']; ?>" />
                            <table border="0" cellpadding="0" cellspacing="2" width="90%">
                                <tbody>
                                    <tr>
                                        <td align="right" width="150"><span class="att">*</span>&nbsp;标题：</td>
                                        <td><input id="C_Title" class="txtBeauty" name="C_Title" style="" type="text" value="<?php echo $code_item['C_Title']; ?>" /></td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td><span class="error"><?php echo form_error('C_Title'); ?></span></td>
                                    </tr>
                                    <tr>
                                        <td align="right" width="150"><span class="att">*</span>&nbsp;语言&nbsp;/&nbsp;分类：</td>
                                        <td align="lift" >
                                            <select name="C_Category" id="C_Category">
                                                <option selected="selected">------</option>
                                                <?php
                                                if (is_array($category)) {
                                                    foreach ($category as $category_item) {
                                                        ?>
                                                        <option <?php if ($category_item['Cate_Name'] == $code_item['Cate_Name']) echo("selected"); ?>  value="<?php echo $category_item['Cate_Id'] ?>"><?php echo $category_item['Cate_Name'] ?></option>
                                                        <?php
                                                    }
                                                }
                                                ?>
                                            </select>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <table style="margin: 10px 0pt;" border="0" cellpadding="0" cellspacing="2" width="100%">
                                <tbody>
                                    <tr>
                                        <td align="right" valign="top" width="150"><span class="att">*</span>&nbsp;描述说明：</td>
                                        <td>
                                            <span class="note">请填写代码的实现原理、应用场景、功能说明、调用示例、注意事项等。</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>
                                            <textarea id="C_Description"  name="C_Description" style="width: 80%; height: 150px;"><?php echo $code_item['C_Description'] ?></textarea>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td></td>
                                        <td><span class="error"><?php echo form_error('C_Description'); ?></span></td>
                                    </tr>
                                    <tr><td colspan="2">&nbsp;</td></tr>
                                    <tr>
                                        <td align="right" valign="top" width="150"><span class="att">*</span>&nbsp;代码正文：</td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td><textarea id="C_CodeContent" name="C_CodeContent" style="width: 80%; height: 260px;"><?php echo $code_item['C_CodeContent'] ?></textarea></td>
                                    </tr>

                                    <tr>
                                        <td></td>
                                        <td><span class="error"><?php echo form_error('C_CodeContent'); ?></span></td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>
                                            <div style="padding:10px 0;">
                                                <input class="buBeauty" type="submit"  name="postsubmit" value="提交"/>
                                                <input class="buBeauty" type="submit" name="searchbtn" value="重置"/>
                                                <input type="hidden" name="itemid" value=""/>
                                                <input type="hidden" name="type" value="news"/>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <?php
                        }
                    }
                    ?>
                </div>
            </div>
            <? echo form_close(); ?>
        </div>
    </body>
</html>
